.class public Lcom/nemustech/regina/ElementMaker;
.super Ljava/lang/Object;
.source "ElementMaker.java"


# static fields
.field private static final DEFAULT_FOLDER_TEXT:Ljava/lang/String; = "Folder"

.field private static final LOG_FLAG:Z = false

.field private static final TAG:Ljava/lang/String; = "ElementMaker"


# instance fields
.field private mImagePlater:Lcom/nemustech/regina/ImagePlater;

.field private mPanelMaker:Lcom/nemustech/regina/PanelMaker;

.field private mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

.field private mReginaPref:Lcom/nemustech/regina/ReginaPreference;

.field private mResCare:Lcom/nemustech/regina/ResourceCare;

.field private mWorld:Lcom/nemustech/tiffany/world/TFWorld;


# direct methods
.method public constructor <init>(Lcom/nemustech/regina/ReginaLauncher;Lcom/nemustech/tiffany/world/TFWorld;F)V
    .locals 1
    .parameter "reginaLauncher"
    .parameter "world"
    .parameter "unitWidth"

    .prologue
    .line 47
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 48
    iput-object p1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    .line 49
    iput-object p2, p0, Lcom/nemustech/regina/ElementMaker;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 50
    invoke-static {}, Lcom/nemustech/regina/PanelMaker;->getInstance()Lcom/nemustech/regina/PanelMaker;

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mPanelMaker:Lcom/nemustech/regina/PanelMaker;

    .line 51
    new-instance v0, Lcom/nemustech/regina/ImagePlater;

    invoke-direct {v0, p1}, Lcom/nemustech/regina/ImagePlater;-><init>(Lcom/nemustech/regina/ReginaLauncher;)V

    iput-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    .line 52
    invoke-static {p1}, Lcom/nemustech/regina/ResourceCare;->getResourceCare(Landroid/content/Context;)Lcom/nemustech/regina/ResourceCare;

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mResCare:Lcom/nemustech/regina/ResourceCare;

    .line 53
    invoke-virtual {p1}, Lcom/nemustech/regina/ReginaLauncher;->getReginaPref()Lcom/nemustech/regina/ReginaPreference;

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mReginaPref:Lcom/nemustech/regina/ReginaPreference;

    .line 54
    return-void
.end method

.method static synthetic access$000(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ReginaLauncher;
    .locals 1
    .parameter "x0"

    .prologue
    .line 33
    iget-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    return-object v0
.end method

.method static synthetic access$100(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ImagePlater;
    .locals 1
    .parameter "x0"

    .prologue
    .line 33
    iget-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    return-object v0
.end method

.method static synthetic access$200(Lcom/nemustech/regina/ElementMaker;)Lcom/nemustech/regina/ResourceCare;
    .locals 1
    .parameter "x0"

    .prologue
    .line 33
    iget-object v0, p0, Lcom/nemustech/regina/ElementMaker;->mResCare:Lcom/nemustech/regina/ResourceCare;

    return-object v0
.end method

.method private getPackageSourceDir(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 6
    .parameter "packageName"
    .parameter "className"

    .prologue
    const/4 v5, 0x0

    const/4 v4, 0x0

    .line 251
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v3

    if-gtz v3, :cond_1

    :cond_0
    move-object v3, v4

    .line 258
    :goto_0
    return-object v3

    .line 252
    :cond_1
    if-eqz p2, :cond_2

    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result v3

    if-gtz v3, :cond_3

    :cond_2
    move-object v3, v4

    goto :goto_0

    .line 253
    :cond_3
    new-instance v1, Landroid/content/Intent;

    const-string v3, "android.intent.action.MAIN"

    invoke-direct {v1, v3, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 254
    .local v1, intent:Landroid/content/Intent;
    invoke-virtual {v1, p1, p2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 255
    iget-object v3, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v3}, Lcom/nemustech/regina/ReginaLauncher;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v3

    invoke-virtual {v3, v1, v5}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v0

    .line 256
    .local v0, appList:Ljava/util/List;,"Ljava/util/List<Landroid/content/pm/ResolveInfo;>;"
    if-eqz v0, :cond_4

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v3

    if-gtz v3, :cond_5

    :cond_4
    move-object v3, v4

    goto :goto_0

    .line 257
    :cond_5
    invoke-interface {v0, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/content/pm/ResolveInfo;

    .line 258
    .local v2, ri:Landroid/content/pm/ResolveInfo;
    iget-object v3, v2, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    iget-object v3, v3, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    iget-object v3, v3, Landroid/content/pm/ApplicationInfo;->sourceDir:Ljava/lang/String;

    goto :goto_0
.end method

.method private setAppIconInfo(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;)V
    .locals 10
    .parameter "c"
    .parameter "element"
    .parameter "intent"

    .prologue
    const/4 v9, 0x0

    .line 262
    invoke-virtual {p3}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;

    move-result-object v2

    .line 263
    .local v2, component:Landroid/content/ComponentName;
    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v5

    .line 264
    .local v5, packageManager:Landroid/content/pm/PackageManager;
    const/4 v0, 0x0

    .line 266
    .local v0, activityInfo:Landroid/content/pm/ActivityInfo;
    const/4 v7, 0x0

    :try_start_0
    invoke-virtual {v5, v2, v7}, Landroid/content/pm/PackageManager;->getActivityInfo(Landroid/content/ComponentName;I)Landroid/content/pm/ActivityInfo;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 271
    :goto_0
    if-eqz v0, :cond_1

    .line 272
    invoke-virtual {v0, v5}, Landroid/content/pm/ActivityInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v6

    .line 273
    .local v6, title:Ljava/lang/String;
    if-nez v6, :cond_0

    .line 274
    iget-object v6, v0, Landroid/content/pm/ActivityInfo;->name:Ljava/lang/String;

    .line 277
    :cond_0
    new-instance v1, Landroid/content/Intent;

    const-string v7, "android.intent.action.MAIN"

    invoke-direct {v1, v7}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 278
    .local v1, appIntent:Landroid/content/Intent;
    const-string v7, "android.intent.category.LAUNCHER"

    invoke-virtual {v1, v7}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;

    .line 279
    invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 280
    const/high16 v7, 0x1020

    invoke-virtual {v1, v7}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 282
    invoke-virtual {v0, v5}, Landroid/content/pm/ActivityInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v4

    .line 284
    .local v4, icon:Landroid/graphics/drawable/Drawable;
    invoke-virtual {p2, v4}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 285
    invoke-virtual {p2, v6}, Lcom/nemustech/regina/ElementShortcut;->setTitle(Ljava/lang/String;)V

    .line 286
    invoke-virtual {p2, v9}, Lcom/nemustech/regina/ElementShortcut;->setItemType(I)V

    .line 287
    invoke-virtual {p2, v1}, Lcom/nemustech/regina/ElementShortcut;->setIntent(Landroid/content/Intent;)V

    .line 288
    invoke-virtual {v2}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {p2, v7}, Lcom/nemustech/regina/ElementShortcut;->setPackageName(Ljava/lang/String;)V

    .line 289
    invoke-virtual {v2}, Landroid/content/ComponentName;->getClassName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {p2, v7}, Lcom/nemustech/regina/ElementShortcut;->setClassName(Ljava/lang/String;)V

    .line 290
    invoke-virtual {v2}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v2}, Landroid/content/ComponentName;->getClassName()Ljava/lang/String;

    move-result-object v8

    invoke-direct {p0, v7, v8}, Lcom/nemustech/regina/ElementMaker;->getPackageSourceDir(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {p2, v7}, Lcom/nemustech/regina/ElementShortcut;->setPackagePath(Ljava/lang/String;)V

    .line 292
    .end local v1           #appIntent:Landroid/content/Intent;
    .end local v4           #icon:Landroid/graphics/drawable/Drawable;
    .end local v6           #title:Ljava/lang/String;
    :cond_1
    return-void

    .line 267
    :catch_0
    move-exception v3

    .line 268
    .local v3, e:Landroid/content/pm/PackageManager$NameNotFoundException;
    const-string v7, "ElementMaker"

    const-string v8, "Couldn\'t find ActivityInfo for selected application"

    invoke-static {v7, v8, v3}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method

.method private setAppIconInfoFromProvider(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;Landroid/database/Cursor;)V
    .locals 20
    .parameter "c"
    .parameter "element"
    .parameter "intent"
    .parameter "cursor"

    .prologue
    .line 295
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v10

    .line 296
    .local v10, packageManager:Landroid/content/pm/PackageManager;
    const/16 v18, 0x0

    move-object v0, v10

    move-object/from16 v1, p3

    move/from16 v2, v18

    invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->resolveActivity(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo;

    move-result-object v15

    .line 297
    .local v15, resolveInfo:Landroid/content/pm/ResolveInfo;
    const-string v18, "title"

    move-object/from16 v0, p4

    move-object/from16 v1, v18

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v17

    .line 298
    .local v17, titleIndex:I
    const-string v18, "iconPackage"

    move-object/from16 v0, p4

    move-object/from16 v1, v18

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v9

    .line 299
    .local v9, iconPackageIndex:I
    const-string v18, "className"

    move-object/from16 v0, p4

    move-object/from16 v1, v18

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v5

    .line 300
    .local v5, classNameIndex:I
    const-string v18, "packageName"

    move-object/from16 v0, p4

    move-object/from16 v1, v18

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v12

    .line 301
    .local v12, packageNameIndex:I
    const-string v18, "packagePath"

    move-object/from16 v0, p4

    move-object/from16 v1, v18

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v14

    .line 303
    .local v14, packagePathIndex:I
    move-object/from16 v0, p4

    move/from16 v1, v17

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v16

    .line 304
    .local v16, title:Ljava/lang/String;
    move-object/from16 v0, p4

    move v1, v12

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v11

    .line 305
    .local v11, packageName:Ljava/lang/String;
    move-object/from16 v0, p4

    move v1, v5

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 306
    .local v4, className:Ljava/lang/String;
    move-object/from16 v0, p4

    move v1, v14

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v13

    .line 308
    .local v13, packagePath:Ljava/lang/String;
    if-nez v15, :cond_0

    .line 309
    invoke-virtual {v10}, Landroid/content/pm/PackageManager;->getDefaultActivityIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v18

    move-object/from16 v0, p2

    move-object/from16 v1, v18

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 310
    move-object/from16 v0, p2

    move-object v1, v11

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setPackageName(Ljava/lang/String;)V

    .line 311
    move-object/from16 v0, p2

    move-object v1, v4

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setClassName(Ljava/lang/String;)V

    .line 332
    :goto_0
    move-object/from16 v0, p2

    move-object/from16 v1, v16

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setTitle(Ljava/lang/String;)V

    .line 333
    const/16 v18, 0x0

    move-object/from16 v0, p2

    move/from16 v1, v18

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setItemType(I)V

    .line 334
    invoke-virtual/range {p2 .. p3}, Lcom/nemustech/regina/ElementShortcut;->setIntent(Landroid/content/Intent;)V

    .line 336
    move-object/from16 v0, p2

    move-object v1, v13

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setPackagePath(Ljava/lang/String;)V

    .line 337
    return-void

    .line 313
    :cond_0
    iget-object v3, v15, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 315
    .local v3, activityInfo:Landroid/content/pm/ActivityInfo;
    invoke-virtual {v3, v10}, Landroid/content/pm/ActivityInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v7

    .line 316
    .local v7, icon:Landroid/graphics/drawable/Drawable;
    move-object/from16 v0, p1

    move-object v1, v7

    invoke-static {v0, v1}, Lcom/nemustech/regina/RUtils;->createIconThumbnail(Landroid/content/Context;Landroid/graphics/drawable/Drawable;)Landroid/graphics/Bitmap;

    move-result-object v8

    .line 317
    .local v8, iconBitmap:Landroid/graphics/Bitmap;
    new-instance v6, Landroid/content/ComponentName;

    move-object v0, v3

    iget-object v0, v0, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    move-object/from16 v18, v0

    move-object/from16 v0, v18

    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    move-object/from16 v18, v0

    move-object v0, v3

    iget-object v0, v0, Landroid/content/pm/ActivityInfo;->name:Ljava/lang/String;

    move-object/from16 v19, v0

    move-object v0, v6

    move-object/from16 v1, v18

    move-object/from16 v2, v19

    invoke-direct {v0, v1, v2}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 318
    .local v6, componentName:Landroid/content/ComponentName;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    move-object/from16 v18, v0

    invoke-virtual/range {v18 .. v18}, Lcom/nemustech/regina/ReginaLauncher;->getAppInfoManager()Lcom/nemustech/regina/AppInfoManager;

    move-result-object v18

    move-object/from16 v0, v18

    move-object v1, v6

    move-object v2, v8

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/regina/AppInfoManager;->putElementBitmapCache(Landroid/content/ComponentName;Landroid/graphics/Bitmap;)V

    .line 319
    move-object/from16 v0, p2

    move-object v1, v7

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 321
    if-eqz v16, :cond_1

    invoke-virtual/range {v16 .. v16}, Ljava/lang/String;->length()I

    move-result v18

    if-nez v18, :cond_2

    .line 322
    :cond_1
    invoke-virtual {v3, v10}, Landroid/content/pm/ActivityInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v18

    invoke-virtual/range {v18 .. v18}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v16

    .line 324
    :cond_2
    if-nez v16, :cond_3

    .line 325
    const-string v16, ""

    .line 328
    :cond_3
    move-object v0, v3

    iget-object v0, v0, Landroid/content/pm/ActivityInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    move-object/from16 v18, v0

    move-object/from16 v0, v18

    iget-object v0, v0, Landroid/content/pm/ApplicationInfo;->packageName:Ljava/lang/String;

    move-object/from16 v18, v0

    move-object/from16 v0, p2

    move-object/from16 v1, v18

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setPackageName(Ljava/lang/String;)V

    .line 329
    move-object v0, v3

    iget-object v0, v0, Landroid/content/pm/ActivityInfo;->name:Ljava/lang/String;

    move-object/from16 v18, v0

    move-object/from16 v0, p2

    move-object/from16 v1, v18

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setClassName(Ljava/lang/String;)V

    goto/16 :goto_0
.end method

.method private setShortcutIconInfo(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;)V
    .locals 16
    .parameter "c"
    .parameter "element"
    .parameter "intent"

    .prologue
    .line 340
    const-string v13, "android.intent.extra.shortcut.INTENT"

    move-object/from16 v0, p3

    move-object v1, v13

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v12

    check-cast v12, Landroid/content/Intent;

    .line 341
    .local v12, scIntent:Landroid/content/Intent;
    const-string v13, "android.intent.extra.shortcut.NAME"

    move-object/from16 v0, p3

    move-object v1, v13

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    .line 342
    .local v9, name:Ljava/lang/String;
    const-string v13, "android.intent.extra.shortcut.ICON"

    move-object/from16 v0, p3

    move-object v1, v13

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v2

    check-cast v2, Landroid/graphics/Bitmap;

    .line 343
    .local v2, bitmap:Landroid/graphics/Bitmap;
    const/4 v5, 0x0

    .line 344
    .local v5, icon:Landroid/graphics/drawable/Drawable;
    const/4 v6, 0x0

    .line 345
    .local v6, iconResource:Landroid/content/Intent$ShortcutIconResource;
    const/4 v8, 0x0

    .line 347
    .local v8, isCustomIcon:Z
    if-eqz v2, :cond_2

    .line 348
    new-instance v5, Landroid/graphics/drawable/BitmapDrawable;

    .end local v5           #icon:Landroid/graphics/drawable/Drawable;
    invoke-direct {v5, v2}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    .line 349
    .restart local v5       #icon:Landroid/graphics/drawable/Drawable;
    const/4 v8, 0x1

    .line 366
    :cond_0
    :goto_0
    if-nez v5, :cond_1

    .line 367
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v13

    invoke-virtual {v13}, Landroid/content/pm/PackageManager;->getDefaultActivityIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v5

    .line 370
    :cond_1
    move-object/from16 v0, p2

    move v1, v8

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIsCustomIcon(Z)V

    .line 371
    move-object/from16 v0, p2

    move-object v1, v5

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 372
    move-object/from16 v0, p2

    move-object v1, v9

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setTitle(Ljava/lang/String;)V

    .line 373
    move-object/from16 v0, p2

    move-object v1, v6

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIconResource(Landroid/content/Intent$ShortcutIconResource;)V

    .line 374
    const/4 v13, 0x1

    move-object/from16 v0, p2

    move v1, v13

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setItemType(I)V

    .line 375
    move-object/from16 v0, p2

    move-object v1, v12

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIntent(Landroid/content/Intent;)V

    .line 376
    return-void

    .line 351
    :cond_2
    const-string v13, "android.intent.extra.shortcut.ICON_RESOURCE"

    move-object/from16 v0, p3

    move-object v1, v13

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object v4

    .line 352
    .local v4, extra:Landroid/os/Parcelable;
    if-eqz v4, :cond_0

    instance-of v13, v4, Landroid/content/Intent$ShortcutIconResource;

    if-eqz v13, :cond_0

    .line 354
    :try_start_0
    move-object v0, v4

    check-cast v0, Landroid/content/Intent$ShortcutIconResource;

    move-object v6, v0

    .line 355
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v10

    .line 356
    .local v10, packageManager:Landroid/content/pm/PackageManager;
    iget-object v13, v6, Landroid/content/Intent$ShortcutIconResource;->packageName:Ljava/lang/String;

    invoke-virtual {v10, v13}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/String;)Landroid/content/res/Resources;

    move-result-object v11

    .line 358
    .local v11, resources:Landroid/content/res/Resources;
    iget-object v13, v6, Landroid/content/Intent$ShortcutIconResource;->resourceName:Ljava/lang/String;

    const/4 v14, 0x0

    const/4 v15, 0x0

    invoke-virtual {v11, v13, v14, v15}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v7

    .line 359
    .local v7, id:I
    invoke-virtual {v11, v7}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v5

    goto :goto_0

    .line 360
    .end local v7           #id:I
    .end local v10           #packageManager:Landroid/content/pm/PackageManager;
    .end local v11           #resources:Landroid/content/res/Resources;
    :catch_0
    move-exception v13

    move-object v3, v13

    .line 361
    .local v3, e:Ljava/lang/Exception;
    const-string v13, "ElementMaker"

    new-instance v14, Ljava/lang/StringBuilder;

    invoke-direct {v14}, Ljava/lang/StringBuilder;-><init>()V

    const-string v15, "Could not load shortcut icon: "

    invoke-virtual {v14, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v14

    invoke-virtual {v14, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v14

    invoke-virtual {v14}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v14

    invoke-static {v13, v14}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method private setShortcutIconInfoFromProvider(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;Landroid/database/Cursor;)V
    .locals 21
    .parameter "c"
    .parameter "element"
    .parameter "intent"
    .parameter "cursor"

    .prologue
    .line 379
    invoke-virtual/range {p1 .. p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v13

    .line 380
    .local v13, packageManager:Landroid/content/pm/PackageManager;
    const-string v19, "title"

    move-object/from16 v0, p4

    move-object/from16 v1, v19

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v18

    .line 381
    .local v18, titleIndex:I
    const-string v19, "iconType"

    move-object/from16 v0, p4

    move-object/from16 v1, v19

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v11

    .line 382
    .local v11, iconTypeIndex:I
    const-string v19, "iconPackage"

    move-object/from16 v0, p4

    move-object/from16 v1, v19

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v8

    .line 383
    .local v8, iconPackageIndex:I
    const-string v19, "iconResource"

    move-object/from16 v0, p4

    move-object/from16 v1, v19

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v9

    .line 384
    .local v9, iconResourceIndex:I
    const-string v19, "icon"

    move-object/from16 v0, p4

    move-object/from16 v1, v19

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v7

    .line 386
    .local v7, iconIndex:I
    move-object/from16 v0, p4

    move/from16 v1, v18

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v17

    .line 387
    .local v17, title:Ljava/lang/String;
    move-object/from16 v0, p4

    move v1, v11

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v10

    .line 389
    .local v10, iconType:I
    move-object/from16 v0, p4

    move v1, v8

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v14

    .line 390
    .local v14, packageName:Ljava/lang/String;
    packed-switch v10, :pswitch_data_0

    .line 419
    invoke-virtual {v13}, Landroid/content/pm/PackageManager;->getDefaultActivityIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v19

    move-object/from16 v0, p2

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    .line 420
    const/16 v19, 0x0

    move-object/from16 v0, p2

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIsCustomIcon(Z)V

    .line 423
    :goto_0
    move-object/from16 v0, p2

    move-object/from16 v1, v17

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setTitle(Ljava/lang/String;)V

    .line 424
    const/16 v19, 0x1

    move-object/from16 v0, p2

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setItemType(I)V

    .line 425
    invoke-virtual/range {p2 .. p3}, Lcom/nemustech/regina/ElementShortcut;->setIntent(Landroid/content/Intent;)V

    .line 426
    return-void

    .line 393
    :pswitch_0
    move-object/from16 v0, p4

    move v1, v9

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v15

    .line 395
    .local v15, resourceName:Ljava/lang/String;
    :try_start_0
    invoke-virtual {v13, v14}, Landroid/content/pm/PackageManager;->getResourcesForApplication(Ljava/lang/String;)Landroid/content/res/Resources;

    move-result-object v16

    .line 396
    .local v16, resources:Landroid/content/res/Resources;
    const/16 v19, 0x0

    const/16 v20, 0x0

    move-object/from16 v0, v16

    move-object v1, v15

    move-object/from16 v2, v19

    move-object/from16 v3, v20

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I

    move-result v12

    .line 397
    .local v12, id:I
    move-object/from16 v0, v16

    move v1, v12

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v19

    move-object/from16 v0, p2

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 405
    .end local v12           #id:I
    .end local v16           #resources:Landroid/content/res/Resources;
    :goto_1
    new-instance v19, Landroid/content/Intent$ShortcutIconResource;

    invoke-direct/range {v19 .. v19}, Landroid/content/Intent$ShortcutIconResource;-><init>()V

    move-object/from16 v0, p2

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIconResource(Landroid/content/Intent$ShortcutIconResource;)V

    .line 406
    const/16 v19, 0x0

    move-object/from16 v0, p2

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIsCustomIcon(Z)V

    goto :goto_0

    .line 398
    :catch_0
    move-exception v19

    move-object/from16 v6, v19

    .line 399
    .local v6, e:Ljava/lang/Exception;
    invoke-virtual {v13}, Landroid/content/pm/PackageManager;->getDefaultActivityIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v19

    move-object/from16 v0, p2

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    goto :goto_1

    .line 409
    .end local v6           #e:Ljava/lang/Exception;
    .end local v15           #resourceName:Ljava/lang/String;
    :pswitch_1
    move-object/from16 v0, p4

    move v1, v7

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v5

    .line 411
    .local v5, data:[B
    const/16 v19, 0x0

    :try_start_1
    move-object v0, v5

    array-length v0, v0

    move/from16 v20, v0

    move-object v0, v5

    move/from16 v1, v19

    move/from16 v2, v20

    invoke-static {v0, v1, v2}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v4

    .line 412
    .local v4, bitmap:Landroid/graphics/Bitmap;
    new-instance v19, Landroid/graphics/drawable/BitmapDrawable;

    move-object/from16 v0, v19

    move-object v1, v4

    invoke-direct {v0, v1}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/graphics/Bitmap;)V

    move-object/from16 v0, p2

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 416
    .end local v4           #bitmap:Landroid/graphics/Bitmap;
    :goto_2
    const/16 v19, 0x1

    move-object/from16 v0, p2

    move/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIsCustomIcon(Z)V

    goto/16 :goto_0

    .line 413
    :catch_1
    move-exception v19

    move-object/from16 v6, v19

    .line 414
    .restart local v6       #e:Ljava/lang/Exception;
    invoke-virtual {v13}, Landroid/content/pm/PackageManager;->getDefaultActivityIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v19

    move-object/from16 v0, p2

    move-object/from16 v1, v19

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setIcon(Landroid/graphics/drawable/Drawable;)V

    goto :goto_2

    .line 390
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method


# virtual methods
.method public createAndroidWidget(I)Lcom/nemustech/regina/Element;
    .locals 5
    .parameter "widgetId"

    .prologue
    const/4 v4, 0x0

    .line 233
    new-instance v0, Lcom/nemustech/regina/ElementAndroidWidget;

    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v0, v1, p1}, Lcom/nemustech/regina/ElementAndroidWidget;-><init>(Lcom/nemustech/regina/ReginaLauncher;I)V

    .line 235
    .local v0, awElement:Lcom/nemustech/regina/ElementAndroidWidget;
    invoke-virtual {v0}, Lcom/nemustech/regina/ElementAndroidWidget;->getInternalObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v1

    if-eqz v1, :cond_0

    invoke-virtual {v0}, Lcom/nemustech/regina/ElementAndroidWidget;->getHostView()Landroid/appwidget/AppWidgetHostView;

    move-result-object v1

    if-nez v1, :cond_1

    .line 236
    :cond_0
    const-string v1, "ElementMaker"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "The AppWidget("

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, v0, Lcom/nemustech/regina/ElementAndroidWidget;->mPackageName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, v0, Lcom/nemustech/regina/ElementAndroidWidget;->mClassName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ") is not available"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2, v4}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 237
    const/4 v0, 0x0

    .line 247
    :goto_0
    return-object v0

    .line 239
    :cond_1
    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementAndroidWidget;->setItemType(I)V

    .line 240
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v1}, Lcom/nemustech/regina/ReginaLauncher;->isSecretMode()Z

    move-result v1

    if-eqz v1, :cond_2

    .line 241
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementAndroidWidget;->setWorkspaceType(I)V

    goto :goto_0

    .line 243
    :cond_2
    invoke-virtual {v0, v4}, Lcom/nemustech/regina/ElementAndroidWidget;->setWorkspaceType(I)V

    goto :goto_0
.end method

.method public createFolder()Lcom/nemustech/regina/Element;
    .locals 7

    .prologue
    const/4 v6, 0x0

    const/4 v5, 0x0

    .line 147
    new-instance v0, Lcom/nemustech/regina/ElementFolder;

    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v0, v4}, Lcom/nemustech/regina/ElementFolder;-><init>(Landroid/content/Context;)V

    .line 148
    .local v0, elementFolder:Lcom/nemustech/regina/ElementFolder;
    const/4 v4, 0x2

    invoke-virtual {v0, v4}, Lcom/nemustech/regina/ElementFolder;->setItemType(I)V

    .line 150
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    invoke-virtual {v4}, Lcom/nemustech/regina/ImagePlater;->getShortcutWidth()I

    move-result v3

    .line 151
    .local v3, scWidth:I
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    invoke-virtual {v4}, Lcom/nemustech/regina/ImagePlater;->getShortcutHeight()I

    move-result v2

    .line 152
    .local v2, scHeight:I
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mPanelMaker:Lcom/nemustech/regina/PanelMaker;

    invoke-virtual {v4, v3, v2}, Lcom/nemustech/regina/PanelMaker;->createPanel(II)Lcom/nemustech/tiffany/world/TFPanel;

    move-result-object v1

    .line 153
    .local v1, panel:Lcom/nemustech/tiffany/world/TFPanel;
    const-string v4, "Folder"

    invoke-virtual {v0, v4}, Lcom/nemustech/regina/ElementFolder;->setTitle(Ljava/lang/String;)V

    .line 159
    new-instance v4, Lcom/nemustech/regina/ElementMaker$2;

    invoke-direct {v4, p0, v0}, Lcom/nemustech/regina/ElementMaker$2;-><init>(Lcom/nemustech/regina/ElementMaker;Lcom/nemustech/regina/ElementFolder;)V

    invoke-virtual {v1, v4}, Lcom/nemustech/tiffany/world/TFPanel;->setJitImageProvider(Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;)V

    .line 166
    invoke-virtual {v1, v5, v6, v6}, Lcom/nemustech/tiffany/world/TFPanel;->setImageResource(ILandroid/graphics/Bitmap;Landroid/graphics/Rect;)Z

    .line 168
    invoke-virtual {v0, v3}, Lcom/nemustech/regina/ElementFolder;->setWidth2D(I)V

    .line 169
    invoke-virtual {v0, v2}, Lcom/nemustech/regina/ElementFolder;->setHeight2D(I)V

    .line 170
    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementFolder;->setPanel(Lcom/nemustech/tiffany/world/TFPanel;)V

    .line 172
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v4}, Lcom/nemustech/regina/ReginaLauncher;->isSecretMode()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 173
    const/4 v4, 0x1

    invoke-virtual {v0, v4}, Lcom/nemustech/regina/ElementFolder;->setWorkspaceType(I)V

    .line 178
    :goto_0
    return-object v0

    .line 175
    :cond_0
    invoke-virtual {v0, v5}, Lcom/nemustech/regina/ElementFolder;->setWorkspaceType(I)V

    goto :goto_0
.end method

.method public createReginaWidget(Lcom/nemustech/regina/widgets/ReginaWidgetID;Landroid/graphics/Rect;IJ)Lcom/nemustech/regina/Element;
    .locals 7
    .parameter "widgetID"
    .parameter "area"
    .parameter "rowNum"
    .parameter "elementId"

    .prologue
    .line 182
    const-string v0, "ElementMaker"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "createReginaWidget rowNum = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Lcom/nemustech/regina/RLog;->d(Ljava/lang/String;Ljava/lang/String;Z)I

    .line 183
    const/4 v6, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move v3, p3

    move-wide v4, p4

    invoke-virtual/range {v0 .. v6}, Lcom/nemustech/regina/ElementMaker;->createReginaWidget(Lcom/nemustech/regina/widgets/ReginaWidgetID;Landroid/graphics/Rect;IJLcom/nemustech/regina/RGWorkspace;)Lcom/nemustech/regina/Element;

    move-result-object v0

    return-object v0
.end method

.method public createReginaWidget(Lcom/nemustech/regina/widgets/ReginaWidgetID;Landroid/graphics/Rect;IJLcom/nemustech/regina/RGWorkspace;)Lcom/nemustech/regina/Element;
    .locals 8
    .parameter "widgetID"
    .parameter "area"
    .parameter "rowNum"
    .parameter "elementId"
    .parameter "targetWS"

    .prologue
    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 187
    const/4 v2, 0x0

    .line 188
    .local v2, reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    sget-object v4, Lcom/nemustech/regina/widgets/ReginaWidgetID;->WEATHER_CLOCK:Lcom/nemustech/regina/widgets/ReginaWidgetID;

    invoke-virtual {p1, v4}, Lcom/nemustech/regina/widgets/ReginaWidgetID;->isEqual(Lcom/nemustech/regina/widgets/ReginaWidgetID;)Z

    move-result v4

    if-eqz v4, :cond_2

    .line 189
    new-instance v2, Lcom/nemustech/regina/widgets/clock/ClockWidget;

    .end local v2           #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v2, v4, p4, p5, p3}, Lcom/nemustech/regina/widgets/clock/ClockWidget;-><init>(Landroid/content/Context;JI)V

    .line 190
    .restart local v2       #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    const/16 v4, 0x7d0

    invoke-virtual {v2, v4}, Lcom/nemustech/regina/ElementReginaWidget;->setItemType(I)V

    .line 205
    :cond_0
    :goto_0
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v4}, Lcom/nemustech/regina/ReginaLauncher;->isSecretMode()Z

    move-result v4

    if-eqz v4, :cond_6

    .line 206
    invoke-virtual {v2, v7}, Lcom/nemustech/regina/ElementReginaWidget;->setWorkspaceType(I)V

    .line 214
    :goto_1
    if-lez p3, :cond_7

    .line 215
    invoke-virtual {v2, p3}, Lcom/nemustech/regina/ElementReginaWidget;->create(I)V

    .line 220
    :goto_2
    invoke-virtual {v2}, Lcom/nemustech/regina/ElementReginaWidget;->update()V

    .line 221
    invoke-virtual {v2}, Lcom/nemustech/regina/ElementReginaWidget;->getInternalObject()Lcom/nemustech/tiffany/world/TFObject;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v0, p0

    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v3, v0

    .line 222
    .local v3, widgetHolder:Lcom/nemustech/tiffany/world/TFHolder;
    invoke-virtual {v3, v7}, Lcom/nemustech/tiffany/world/TFHolder;->banChiselFringe(Z)V

    .line 223
    instance-of v4, v2, Lcom/nemustech/regina/widgets/clock/ClockWidget;

    if-eqz v4, :cond_1

    .line 224
    move-object v0, v2

    check-cast v0, Lcom/nemustech/regina/widgets/clock/ClockWidget;

    move-object v4, v0

    invoke-virtual {v4, v6}, Lcom/nemustech/regina/widgets/clock/ClockWidget;->digitHolderBanChiselFringe(Z)V

    .line 229
    :cond_1
    return-object v2

    .line 191
    .end local v3           #widgetHolder:Lcom/nemustech/tiffany/world/TFHolder;
    .restart local p0
    :cond_2
    sget-object v4, Lcom/nemustech/regina/widgets/ReginaWidgetID;->APPOINTMENT:Lcom/nemustech/regina/widgets/ReginaWidgetID;

    invoke-virtual {p1, v4}, Lcom/nemustech/regina/widgets/ReginaWidgetID;->isEqual(Lcom/nemustech/regina/widgets/ReginaWidgetID;)Z

    move-result v4

    if-eqz v4, :cond_3

    .line 192
    new-instance v2, Lcom/nemustech/regina/widgets/appointment/AppointmentWidget;

    .end local v2           #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v2, v4}, Lcom/nemustech/regina/widgets/appointment/AppointmentWidget;-><init>(Landroid/content/Context;)V

    .line 193
    .restart local v2       #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    const/16 v4, 0x7d1

    invoke-virtual {v2, v4}, Lcom/nemustech/regina/ElementReginaWidget;->setItemType(I)V

    goto :goto_0

    .line 194
    :cond_3
    sget-object v4, Lcom/nemustech/regina/widgets/ReginaWidgetID;->TASKS:Lcom/nemustech/regina/widgets/ReginaWidgetID;

    invoke-virtual {p1, v4}, Lcom/nemustech/regina/widgets/ReginaWidgetID;->isEqual(Lcom/nemustech/regina/widgets/ReginaWidgetID;)Z

    move-result v4

    if-eqz v4, :cond_4

    .line 195
    new-instance v2, Lcom/nemustech/regina/widgets/tasks/TasksWidget;

    .end local v2           #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v2, v4}, Lcom/nemustech/regina/widgets/tasks/TasksWidget;-><init>(Landroid/content/Context;)V

    .line 196
    .restart local v2       #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    const/16 v4, 0x7d2

    invoke-virtual {v2, v4}, Lcom/nemustech/regina/ElementReginaWidget;->setItemType(I)V

    goto :goto_0

    .line 197
    :cond_4
    sget-object v4, Lcom/nemustech/regina/widgets/ReginaWidgetID;->APP_MANAGER:Lcom/nemustech/regina/widgets/ReginaWidgetID;

    invoke-virtual {p1, v4}, Lcom/nemustech/regina/widgets/ReginaWidgetID;->isEqual(Lcom/nemustech/regina/widgets/ReginaWidgetID;)Z

    move-result v4

    if-eqz v4, :cond_5

    .line 198
    new-instance v2, Lcom/nemustech/regina/widgets/appmanager/AppManagerWidget;

    .end local v2           #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v2, v4}, Lcom/nemustech/regina/widgets/appmanager/AppManagerWidget;-><init>(Landroid/content/Context;)V

    .line 199
    .restart local v2       #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    const/16 v4, 0x7d3

    invoke-virtual {v2, v4}, Lcom/nemustech/regina/ElementReginaWidget;->setItemType(I)V

    goto :goto_0

    .line 200
    :cond_5
    sget-object v4, Lcom/nemustech/regina/widgets/ReginaWidgetID;->MISSED_NOTI:Lcom/nemustech/regina/widgets/ReginaWidgetID;

    invoke-virtual {p1, v4}, Lcom/nemustech/regina/widgets/ReginaWidgetID;->isEqual(Lcom/nemustech/regina/widgets/ReginaWidgetID;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 201
    new-instance v2, Lcom/nemustech/regina/widgets/missednoti/MissedNotiWidget;

    .end local v2           #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v2, v4}, Lcom/nemustech/regina/widgets/missednoti/MissedNotiWidget;-><init>(Landroid/content/Context;)V

    .line 202
    .restart local v2       #reginaWidget:Lcom/nemustech/regina/ElementReginaWidget;
    const/16 v4, 0x7d4

    invoke-virtual {v2, v4}, Lcom/nemustech/regina/ElementReginaWidget;->setItemType(I)V

    goto :goto_0

    .line 208
    :cond_6
    invoke-virtual {v2, v6}, Lcom/nemustech/regina/ElementReginaWidget;->setWorkspaceType(I)V

    goto :goto_1

    .line 217
    :cond_7
    if-eqz p2, :cond_8

    move-object v1, p2

    .line 218
    .local v1, maxArea:Landroid/graphics/Rect;
    :goto_3
    invoke-virtual {v2, v1}, Lcom/nemustech/regina/ElementReginaWidget;->create(Landroid/graphics/Rect;)V

    goto :goto_2

    .line 217
    .end local v1           #maxArea:Landroid/graphics/Rect;
    :cond_8
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v4}, Lcom/nemustech/regina/ReginaLauncher;->getElementLocator()Lcom/nemustech/regina/ElementLocator;

    move-result-object v4

    const/4 v5, 0x0

    invoke-virtual {v4, v5, p6}, Lcom/nemustech/regina/ElementLocator;->getMaxReginaWidgetSpace(Lcom/nemustech/regina/Element;Lcom/nemustech/regina/RGWorkspace;)Landroid/graphics/Rect;

    move-result-object v4

    move-object v1, v4

    goto :goto_3
.end method

.method public createShortcut(Landroid/content/Intent;Z)Lcom/nemustech/regina/Element;
    .locals 1
    .parameter "intent"
    .parameter "isShortcut"

    .prologue
    .line 57
    const/4 v0, 0x0

    invoke-virtual {p0, p1, p2, v0}, Lcom/nemustech/regina/ElementMaker;->createShortcutFromProvider(Landroid/content/Intent;ZLandroid/database/Cursor;)Lcom/nemustech/regina/Element;

    move-result-object v0

    return-object v0
.end method

.method public createShortcutFromProvider(Landroid/content/Intent;ZLandroid/database/Cursor;)Lcom/nemustech/regina/Element;
    .locals 2
    .parameter "intent"
    .parameter "isShortcut"
    .parameter "cursor"

    .prologue
    .line 61
    new-instance v0, Lcom/nemustech/regina/ElementShortcut;

    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v0, v1}, Lcom/nemustech/regina/ElementShortcut;-><init>(Landroid/content/Context;)V

    .line 62
    .local v0, element:Lcom/nemustech/regina/ElementShortcut;
    if-eqz p2, :cond_1

    .line 63
    if-nez p3, :cond_0

    .line 64
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {p0, v1, v0, p1}, Lcom/nemustech/regina/ElementMaker;->setShortcutIconInfo(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;)V

    .line 76
    :goto_0
    invoke-virtual {p0, v0}, Lcom/nemustech/regina/ElementMaker;->initElementPanel(Lcom/nemustech/regina/ElementShortcut;)V

    .line 78
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-virtual {v1}, Lcom/nemustech/regina/ReginaLauncher;->isSecretMode()Z

    move-result v1

    if-eqz v1, :cond_3

    .line 79
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setWorkspaceType(I)V

    .line 84
    :goto_1
    return-object v0

    .line 66
    :cond_0
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {p0, v1, v0, p1, p3}, Lcom/nemustech/regina/ElementMaker;->setShortcutIconInfoFromProvider(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;Landroid/database/Cursor;)V

    goto :goto_0

    .line 69
    :cond_1
    if-nez p3, :cond_2

    .line 70
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {p0, v1, v0, p1}, Lcom/nemustech/regina/ElementMaker;->setAppIconInfo(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;)V

    goto :goto_0

    .line 72
    :cond_2
    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {p0, v1, v0, p1, p3}, Lcom/nemustech/regina/ElementMaker;->setAppIconInfoFromProvider(Landroid/content/Context;Lcom/nemustech/regina/ElementShortcut;Landroid/content/Intent;Landroid/database/Cursor;)V

    goto :goto_0

    .line 81
    :cond_3
    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementShortcut;->setWorkspaceType(I)V

    goto :goto_1
.end method

.method public createTrash()Lcom/nemustech/regina/Element;
    .locals 6

    .prologue
    .line 127
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mResCare:Lcom/nemustech/regina/ResourceCare;

    const v5, 0x7f060033

    invoke-virtual {v4, v5}, Lcom/nemustech/regina/ResourceCare;->getDimensionI(I)I

    move-result v3

    .line 128
    .local v3, trashWidth:I
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mResCare:Lcom/nemustech/regina/ResourceCare;

    const v5, 0x7f060034

    invoke-virtual {v4, v5}, Lcom/nemustech/regina/ResourceCare;->getDimensionI(I)I

    move-result v2

    .line 130
    .local v2, trashHeight:I
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mPanelMaker:Lcom/nemustech/regina/PanelMaker;

    invoke-virtual {v4, v3, v2}, Lcom/nemustech/regina/PanelMaker;->createPanel(II)Lcom/nemustech/tiffany/world/TFPanel;

    move-result-object v1

    .line 131
    .local v1, panel:Lcom/nemustech/tiffany/world/TFPanel;
    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    const/4 v5, 0x0

    invoke-virtual {v4, v1, v3, v2, v5}, Lcom/nemustech/regina/ImagePlater;->plateTrash(Lcom/nemustech/tiffany/world/TFPanel;IIZ)V

    .line 133
    new-instance v0, Lcom/nemustech/regina/ElementTrash;

    iget-object v4, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v0, v4}, Lcom/nemustech/regina/ElementTrash;-><init>(Landroid/content/Context;)V

    .line 134
    .local v0, element:Lcom/nemustech/regina/ElementTrash;
    invoke-virtual {v0, v1}, Lcom/nemustech/regina/ElementTrash;->setPanel(Lcom/nemustech/tiffany/world/TFPanel;)V

    .line 135
    invoke-virtual {v0, v3}, Lcom/nemustech/regina/ElementTrash;->setWidth2D(I)V

    .line 136
    invoke-virtual {v0, v2}, Lcom/nemustech/regina/ElementTrash;->setHeight2D(I)V

    .line 138
    return-object v0
.end method

.method public createWorkspaceControlBtn()Lcom/nemustech/regina/Element;
    .locals 2

    .prologue
    .line 142
    new-instance v0, Lcom/nemustech/regina/ElementWorkspaceControlBtn;

    iget-object v1, p0, Lcom/nemustech/regina/ElementMaker;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    invoke-direct {v0, v1}, Lcom/nemustech/regina/ElementWorkspaceControlBtn;-><init>(Lcom/nemustech/regina/ReginaLauncher;)V

    .line 143
    .local v0, wsControlBtn:Lcom/nemustech/regina/ElementWorkspaceControlBtn;
    return-object v0
.end method

.method public initElementPanel(Lcom/nemustech/regina/ElementShortcut;)V
    .locals 5
    .parameter "element"

    .prologue
    const/4 v4, 0x0

    .line 88
    iget-object v3, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    invoke-virtual {v3}, Lcom/nemustech/regina/ImagePlater;->getShortcutWidth()I

    move-result v2

    .line 89
    .local v2, scWidth:I
    iget-object v3, p0, Lcom/nemustech/regina/ElementMaker;->mImagePlater:Lcom/nemustech/regina/ImagePlater;

    invoke-virtual {v3}, Lcom/nemustech/regina/ImagePlater;->getShortcutHeight()I

    move-result v1

    .line 90
    .local v1, scHeight:I
    iget-object v3, p0, Lcom/nemustech/regina/ElementMaker;->mPanelMaker:Lcom/nemustech/regina/PanelMaker;

    invoke-virtual {v3, v2, v1}, Lcom/nemustech/regina/PanelMaker;->createPanel(II)Lcom/nemustech/tiffany/world/TFPanel;

    move-result-object v0

    .line 92
    .local v0, panel:Lcom/nemustech/tiffany/world/TFPanel;
    const/4 v3, 0x1

    invoke-virtual {v0, v3}, Lcom/nemustech/tiffany/world/TFPanel;->banChiselFringe(Z)V

    .line 93
    new-instance v3, Lcom/nemustech/regina/ElementMaker$1;

    invoke-direct {v3, p0, p1}, Lcom/nemustech/regina/ElementMaker$1;-><init>(Lcom/nemustech/regina/ElementMaker;Lcom/nemustech/regina/ElementShortcut;)V

    invoke-virtual {v0, v3}, Lcom/nemustech/tiffany/world/TFPanel;->setJitImageProvider(Lcom/nemustech/tiffany/world/TFModel$JitImageProvider;)V

    .line 115
    const/4 v3, 0x0

    invoke-virtual {v0, v3, v4, v4}, Lcom/nemustech/tiffany/world/TFPanel;->setImageResource(ILandroid/graphics/Bitmap;Landroid/graphics/Rect;)Z

    .line 121
    invoke-virtual {p1, v2}, Lcom/nemustech/regina/ElementShortcut;->setWidth2D(I)V

    .line 122
    invoke-virtual {p1, v1}, Lcom/nemustech/regina/ElementShortcut;->setHeight2D(I)V

    .line 123
    invoke-virtual {p1, v0}, Lcom/nemustech/regina/ElementShortcut;->setPanel(Lcom/nemustech/tiffany/world/TFPanel;)V

    .line 124
    return-void
.end method
